//
//  HomeComDataCell.m
//  Ginix
//
//  Created by fzq on 2025/2/23.
//

#import "HomeComDataCell.h"
#import "HomeComDataView.h"

@interface HomeComDataCell()
@property (nonatomic,strong) HomeComDataView * nameView;
@property (nonatomic,strong) HomeComDataView * infoView;
@property (nonatomic,strong) HomeComDataView * descView;
@property (nonatomic,strong) HomeComDataView * detaView;
@end

@implementation HomeComDataCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setSubViewLayout];
    }
    return self;
}
-(void)setSubViewLayout{
    
    [self addSubview:self.nameView];
    [_nameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(16 * FMScaleX);
        make.top.mas_offset(12 * FMScaleX);
        make.size.mas_offset(CGSizeMake(165 * FMScaleX, 100 * FMScaleX));
    }];
    [self addSubview:self.infoView];
    [_infoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.top.equalTo(self.nameView);
        make.left.equalTo(self.nameView.mas_right).offset(13 * FMScaleX);
        
    }];
    [self addSubview:self.descView];
    [_descView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.left.equalTo(self.nameView);
        make.top.equalTo(self.nameView.mas_bottom).offset(12 * FMScaleX);
    }];
    [self addSubview:self.detaView];
    [_detaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.equalTo(self.nameView);
        make.centerX.equalTo(self.infoView);
        make.top.equalTo(self.descView);
    }];
}

-(void)setInfoModel:(HomeAllCheckInfoModel *)infoModel{
    
    
    self.nameView.infoLabel.text = infoModel.dialectical.yinyang;
    self.infoView.infoLabel.text = infoModel.dialectical.biaoli;
    self.descView.infoLabel.text = infoModel.dialectical.hanre;
    self.detaView.infoLabel.text = infoModel.dialectical.xushi;
    
}


-(HomeComDataView *)nameView{
    
    if(!_nameView){
        _nameView = [[HomeComDataView alloc]init];
        _nameView.nameLabel.text = @"阴阳辨证";
    }
    return _nameView;
}
-(HomeComDataView *)infoView{
    
    if(!_infoView){
        _infoView = [[HomeComDataView alloc]init];
        _infoView.nameLabel.text = @"表里辨证";
    }
    return _infoView;
}
-(HomeComDataView *)descView{
    
    if(!_descView){
        _descView = [[HomeComDataView alloc]init];
        _descView.nameLabel.text = @"寒热辨证";
    }
    return _descView;
}
-(HomeComDataView *)detaView{
    
    if(!_detaView){
        _detaView = [[HomeComDataView alloc]init];
        _detaView.nameLabel.text = @"虚实辨证";
    }
    return _detaView;
}
@end
